package com.jy.service.impl;

import com.jy.entity.PageInfo;
import com.jy.entity.Proprietor;
import com.jy.mapper.ProprietorMapper;
import com.jy.service.IProprietorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * illustriousness.`t_proprietor` 服务实现类
 * </p>
 *
 * @author Null
 * @since 2022-11-14
 */
@Service
public class ProprietorServiceImpl extends ServiceImpl<ProprietorMapper,Proprietor> implements IProprietorService {

    @Resource
    private ProprietorMapper proprietorMapper;

    @Override
    public PageInfo allprop(PageInfo pageInfo) {
        pageInfo.setTotalRow(proprietorMapper.selectcount());//查总页数
        pageInfo.setDatas(proprietorMapper.allprop(pageInfo));//根据开始行和每页行数 查当前页数据
        return pageInfo;
    }

    @Override
    public boolean deleteprop(Integer id) {
        return proprietorMapper.deleteprop(id);
    }

    @Override
    public Proprietor selectbyid(Integer id) {
        return proprietorMapper.selectbyid(id);
    }

    @Override
    public boolean updprop(Proprietor proprietor) {
        return proprietorMapper.updprop(proprietor);
    }

    @Override
    public boolean addprop(Proprietor proprietor) {
        return proprietorMapper.insertprop(proprietor);
    }


}
